# $LastChangedDate: 2010-05-25 21:26:05 -0400 (Tue, 25 May 2010) $
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG
# Find PLIB.
# Output:
# PLIB_FOUND
# PLIB_INC_DIR
# PLIB_LIBS
# Notes:
# - See module.txt.
#-------------------------------------------------------------------------------

INCLUDE( CMakeModules/inc_find.cmake )

#-------------------------------------------------------------------------------
# Find include directory : PLIB_INC_DIR

FIND_PATH( PLIB_INC_DIR
    NAMES plib/sl.h
    PATHS ${POSSIBLE_INC_DIRS}
)

#-------------------------------------------------------------------------------
# Find library : PLIB_LIBS

FIND_LIBRARY( PLIB_LIBS
    NAMES plibsl
    PATH  ${POSSIBLE_LIB_DIRS}
)

#-------------------------------------------------------------------------------
# Found everything?

IF( PLIB_INC_DIR AND PLIB_LIBS )
    SET( PLIB_FOUND "TRUE" )
    MESSAGE( STATUS "Found PLIB: ${PLIB_LIBS}" )
ELSE()
    IF( PLIB_FIND_REQUIRED )
        MESSAGE( FATAL_ERROR "Could not find PLIB" )
    ENDIF()
ENDIF()
